# Maintainer: Michał Polański <michal@polanski.me>
pkgname=biome
pkgver=1.4.1
pkgrel=0
pkgdesc="Toolchain of the web"
url="https://biomejs.dev/"
license="MIT"
arch="aarch64 x86_64" # architectures supported by upstream
makedepends="cargo cargo-auditable"
source="https://github.com/biomejs/biome/archive/cli/v$pkgver/biome-$pkgver.tar.gz"
builddir="$srcdir/biome-cli-v$pkgver"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked

	git init
	git config --local user.name "example"
	git config --local user.email "example@example.com"
	git add .
	git commit -m "needed for symlink tests"
}

build() {
	BIOME_VERSION="$pkgver" cargo auditable build -p biome_cli --frozen --release
}

check() {
	cargo test -p biome_cli --frozen
}

package() {
	install -Dm755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
527558299e8324bc45c1d5a4fb2d8bdc3d143bbc43239ed1f2c8f3367f819ec25e53623c5afb64a2ebffbc2b5fb1eb19fc6755004ad381369c37ec5b83636dbf  biome-1.4.1.tar.gz
"
